home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
TPUG - Toronto PET Users Group
/
TPUG Users Group CD
/
TPUG Users Group CD.iso
/
COMAL
/
B-Book Series
/
(k)b4.d64
/
example11.4
< prev
next >
Wrap
Text File
|
2007-02-28
|
796b
|
29 lines
0010 PRINT "TV REPAIR SIMULATION"
0020 DIM ARR(20), SER(20), ENT(20), COMP(20)
0030 ARR(1):=-40*LOG(RND(1))
0040 FOR JOB:=2 TO 20 DO
0050 INTER:=-40*LOG(RND(1))
0060 ARR(JOB):=ARR(JOB-1)+INTER
0070 ENDFOR JOB
0080 FOR JOB:=1 TO 20 DO
0090 SER(JOB):=-30*LOG(RND(1))
0100 ENDFOR JOB
0110 ENT(1):=ARR(1); COMP(1):=ENT(1)+SER(1)
0120 FOR JOB:=2 TO 20 DO
0130 IF ARR(JOB)>COMP(JOB-1) THEN
0140 ENT(JOB):=ARR(JOB)
0150 ELSE
0160 ENT(JOB):=COMP(JOB-1)
0170 ENDIF
0180 COMP(JOB):=ENT(JOB)+SER(JOB)
0190 ENDFOR JOB
0200 ZONE 8
0210 PRINT "JOB ARRIVAL SERVICE ENTRY COMPLETION"
0220 FOR JOB:=1 TO 20 DO
0230 ARR(JOB):=INT(ARR(JOB)+.5)
0240 SER(JOB):=INT(SER(JOB)+.5)
0250 ENT(JOB):=INT(ENT(JOB)+.5)
0260 COMP(JOB):=INT(COMP(JOB)+.5)
0270 PRINT JOB,ARR(JOB),SER(JOB),ENT(JOB),COMP(JOB)
0280 ENDFOR JOB